package com.zondy.mapgis.explorer;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;

import com.zondy.mapgis.android.activity.MapActivity;
import com.zondy.mapgis.android.base.BaseActivity;
import com.zondy.mapgis.explorer.R;

/**
 * 程序启动界面
 * 
 * @author fjl
 * @version 1.0
 * 
 */
public class Launcher extends BaseActivity
{
	
	/** 当前Activity渲染的视图View **/
	private View mContextView = null;
	
	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		// 设置渲染视图View
		mContextView = LayoutInflater.from(this).inflate(R.layout.activity_launcher, null);
		setContentView(mContextView);
		initView();
	}

	/**
	 * 初始化窗体
	 */
	public void initView()
	{

		// 添加动画效果
		AlphaAnimation animation = new AlphaAnimation(0.3f, 1.0f);
		animation.setDuration(1500);
		animation.setAnimationListener(new AnimationListener()
		{

			@Override
			public void onAnimationStart(Animation animation)
			{

			}

			@Override
			public void onAnimationRepeat(Animation animation)
			{

			}

			@Override
			public void onAnimationEnd(Animation animation)
			{
				// 跳转界面
				startActivity(new Intent(getApplicationContext(), MapActivity.class));
				finish();
				// 右往左推出效果
//				overridePendingTransition(R.anim.push_left_in, R.anim.push_left_out);
				// Android内置的
				 overridePendingTransition(android.R.anim.slide_in_left,android.R.anim.slide_out_right);
			}
		});
		mContextView.setAnimation(animation);
	}

	@Override
	public void resume()
	{
		// TODO Auto-generated method stub
		
	}

	@Override
	public void destroy()
	{
		// TODO Auto-generated method stub
		
	}


}